
fid=fopen('datapic6.txt', 'r');
subplot(2,2,1);
sp2=textscan(fid, '%f\t%f');
plot(sp2{1}, sp2{2},'LineWidth',1)

%axis([0 4*1024 -0.5 0.5])
xlabel('Time')
title('Transmitted field')
Y2 = fft(sp2{2});

dt=7.064385e-02;
ndt=32768;
w0=5.700000e-02;

dw=2*pi/ndt/dt;
wmax=pi/dt;
subplot(2,2,2);
w=0:dw:wmax-dw;
plot(w/w0,log10((abs(Y2(1:length(Y2)/2)))  ))

%Pyy = Y.* conj(Y);
%plot(s{1},Pyy)
xlim([0 20])
title('Spectrum of the tansmitted field')
xlabel('frequency in harmonics')

fclose(fid);


fid2=fopen('datapic5.txt', 'r');
subplot(2,2,3);
sp1=textscan(fid2, '%f\t%f');
plot(sp1{1}, sp1{2},'r','LineWidth',1)

%axis([0 4*1024 -0.5 0.5])
xlabel('Time')
title('Reflected field')

Y1 = fft(sp1{2});

w0=5.700000e-02;

dw=2*pi/ndt/dt;
wmax=pi/dt;
subplot(2,2,4);
w=0:dw:wmax-dw;
plot(w/w0,log10((abs(Y1(1:length(Y1)/2)))), 'r')

%Pyy = Y.* conj(Y);
%plot(s{1},Pyy)
xlim([0 20])
title('Spectrum of the reflected field')
xlabel('frequency in harmonics')
figure
fclose(fid2);





fid3=fopen('datapic4.txt', 'r');

pos=textscan(fid3, '%f\t%f');
plot(pos{1}, pos{2},'Linestyle','none','Marker','.','MarkerSize',1);
figure
plot(pos{1}, pos{2});

%axis([0 4*1024 -0.5 0.5])
xlabel('Time')
ylabel('Position')
title('Trayectories of the particles in time')


fclose(fid3);